From ae1bb3b2614784b30053b9af4f67364981ce98c3 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 10 Feb 2004 13:51:23 +0000 Subject: [PATCH] Add -N option to suppress smart icons. --- defs.h | 1 + main.c | 4 ++++ mingw/Makefile | 2 +- mingw/mkwintesto.c | 14 +++++++++++++- util.c | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/defs.h b/defs.h index 5bd68dae4..807b2362c 100644 --- a/defs.h +++ b/defs.h @@ -67,6 +67,7 @@ typedef struct { int debug_level; gpsdata_type objective; int verbose_status; /* set by GUI wrappers for status */ + int no_smart_icons; } global_options; extern global_options global_opts; diff --git a/main.c b/main.c index 6c63cccc6..5d0490a3d 100644 --- a/main.c +++ b/main.c @@ -51,6 +51,7 @@ usage(const char *pname) " -r Process route information\n" " -t Process track information\n" " -w Process waypoint information [default]\n" +" -N No smart icons on output\n" " -x filtername Invoke filter\n" " -D level Set debug level [%d]\n" "\n" @@ -167,6 +168,9 @@ main(int argc, char *argv[]) case 'r': global_opts.objective = rtedata; break; + case 'N': + global_opts.no_smart_icons = 1; + break; case 'x': optarg = argv[argn][2] ? argv[argn]+2 : argv[++argn]; diff --git a/mingw/Makefile b/mingw/Makefile index c3ad1a0f6..03967bc59 100644 --- a/mingw/Makefile +++ b/mingw/Makefile @@ -14,7 +14,7 @@ gpsbabel.exe: $(OBJS) cp gpsbabel.exe /tmp mkwintesto: mkwintesto.c - /usr/bin/cc mkwintesto.c ../util.c -o mkwintesto + /usr/bin/cc mkwintesto.c -o mkwintesto wintesto.cmd: mkwintesto ./mkwintesto ../testo diff --git a/mingw/mkwintesto.c b/mingw/mkwintesto.c index be4997388..24bad24e2 100644 --- a/mingw/mkwintesto.c +++ b/mingw/mkwintesto.c @@ -29,6 +29,7 @@ #include #include +#include #define LINELENGTH 200 #define MYNAME "MkWinTesto" @@ -80,9 +81,20 @@ int f_outputLine ( return 0; } +/* ------------------------------------------------------------------------------------ */ +void +fatal(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + exit(1); +} + /* ------------------------------------------------------------------------------------ */ int main( - int argc, +int argc, char *argv[]) { char acLineIn[LINELENGTH]; diff --git a/util.c b/util.c index f4628e316..354ace1c3 100644 --- a/util.c +++ b/util.c @@ -453,6 +453,9 @@ get_tz_offset(void) const char * get_cache_icon(const waypoint *waypointp) { + if (global_opts.no_smart_icons) + return NULL; + /* * For icons, type overwrites container. So a multi-micro will * get the icons for "multi". -- 2.30.2